// pages/detail/detail.js
Page({
  data: {
    detail: {},
    loading: false
  },
  onLoad (options) {
    this.initData(options.id)
  },
  initData (id) {
    wx.showLoading({
      title: '正在拼命加载...',
      mask: true
    })
    wx.request({
      url: `https://data.miaov.com/h5-view/v/movie/detail/?id=${id}`,
      success: res => {
        this.setData({
          detail: res.data,
          loading: true
        })
        wx.hideLoading()
        wx.setNavigationBarTitle({
          title: res.data.title,
        })
      }
    })
  },
  peopleDetail (e) {
    // wx.navigateTo({
    //   url: '',
    // })
    console.log(e.currentTarget.dataset.id)
  }
})